#include <stdio.h>
#include "TelephoneBook.h"
#include "MyString.h"
#include <stdlib.h>

enum choice
{
    ADD = 1,
    DELETE,
    FINDN,
    MODIFY,
    PRINT,
    BREAK
};

int main()
{
    Telebook t;
    Init_Telebook(&t);
    int choice = 0;
    // interface(&t);
    while (1)
    {
        system("clear");
        printf("请选择需要执行的功能1-6:\n");
        Interface(&t);
        scanf("%d", &choice);
        system("clear");
        switch (choice)
        {
        case ADD:
            Add_User(&t);
            break;
        case DELETE:
            Delete_User(&t);
            break;
        case FINDN:
            Find_User(&t);
            break;
        case MODIFY:
            Modify_User(&t);
            break;
        case PRINT:
            Print_Telebook(&t);
            break;
        case BREAK:
            return 0;
            break;
        default:
            printf("请输入正确的序号!\n");
            break;
        }
    }
}
